package com.token.sysorg.services;
import com.token.sql.IntegrateSql;
import com.token.sql.PrepareSql;

import java.sql.ResultSet;
import com.token.base.FuncUtil;
import com.token.base.JsonGenerator;
import com.token.base.Pl;
/**
 *
 * @author 代码创建
 */
public class getSubCompanyBy_ComID{
	//Gson gson;
	public getSubCompanyBy_ComID(){
		//gson = new Gson();
	}

	/**
	 *
	 * @param F
	 * @param iSql
	 * @throws Exception
	 */
	public void ReadData(FuncUtil F,IntegrateSql iSql) throws Exception {
		String unitsql = "select ComID,UnitID,UnitName from F_Sys_Unit where ParentID=? and SysID=?";
		PrepareSql psql = new PrepareSql(iSql);
		psql.setPrepare(unitsql);
		psql.setPstValue(1, F.getUrlQueryString("comId", true, "公司编号"));
		psql.setPstValue(2, Pl.getSysId());
		ResultSet rs = psql.executeQuery();
		F.putJsonData("data", JsonGenerator.toJsonArray(rs));
	}

}
